import httpRequest from '@/utils/httpRequest'

export function getConfigList (data) {
  return httpRequest({
    url: httpRequest.adornUrl('/sys/config/list'),
    method: 'get',
    params: httpRequest.adornParams(data)
  })
}

export function deleteConfig (ids, openDefultdata = true) {
  return httpRequest({
    url: httpRequest.adornUrl('/sys/config/delete'),
    method: 'post',
    data: httpRequest.adornData(ids, openDefultdata)
  })
}

export function configInfoById (id) {
  return httpRequest({
    url: httpRequest.adornUrl(`/sys/config/info/${id}`),
    method: 'get',
    params: httpRequest.adornParams()
  })
}

export function configInfoSave (data) {
  return httpRequest({
    url: httpRequest.adornUrl(`/sys/config/${!data.id ? 'save' : 'update'}`),
    method: 'post',
    data: httpRequest.adornData(data)
  })
}
